Text Translation
Function:
tmt.translation(source_text,source,target)Description: text translation
Required parameter:
- source_text: text to be translated. The text is encoded using utf-8m format. Non-utf-8-encoded characters will fail to be translated
- source: source language, supporting: auto: automatic recognition (recognize as a language); zh: simplified Chinese; zh TW: traditional Chinese; en: English; ja: Japanese; ko: Korean; fr: French; es: Spanish; it: Italian; de: Germen; tr: Turkish; ru: Russian; pt: Portuguese; vi: Vietnamese; id: Indonesian; th: Thai; ms: Bahasa Melayuar; ar: Arabic; hi: Hindi
- target: target language
- Return:
- data: content after translation
Example
text = "嘻嘻嘻嘻嘻" result = tmt.translation(text, source="zh", target="en") print(result)Translate the content of text from Chinese into English.